package com.yulongtian.controller;

import com.yulongtian.domain.User;
import com.yulongtian.service.LoginService;
import com.yulongtian.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yulongTian
 * @create 2022-10-30 10:10
 */
@RestController
@RequestMapping("/sys_user")
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("/login")
    public R login(@RequestBody User user) {
        //登录
        return loginService.login(user);
    }

    @RequestMapping("/logout")
    public R logout() {
        return loginService.logout();
    }

}
